{$layout}
{$template "../settings_menu"}
{$template "/left_menu_with_menu"}

<div class="right-box with-menu">
    <form class="ui form" data-tea-action="$" data-tea-success="success">
        <csrf-token></csrf-token>
        <input type="hidden" name="serverId" :value="serverId"/>
        <table class="ui table selectable definition">
            <tr>
                <td class="title">当前服务CNAME</td>
                <td>
                    <span id="cname-text">{{dnsName}}.<span v-if="dnsDomain.length > 0">{{dnsDomain}}</span><span v-else>根域名</span></span> &nbsp; <copy-to-clipboard :v-target="'cname-text'"></copy-to-clipboard> &nbsp;<a href="" @click.prevent="regenerateCNAME()" style="font-size: 0.8em">[重新生成]</a> &nbsp; <a href="" @click.prevent="updateCNAME()" style="font-size: 0.8em">[手动修改]</a>
                    <p class="comment">你需要为你的每个<a :href="'/servers/server/settings/serverNames?serverId=' + serverId">网站域名</a>设置一个CNAME解析，值为上面内容。</p>
                </td>
            </tr>
            <tr>
                <td>支持任意域名CNAME</td>
                <td>
                    <checkbox name="supportCNAME" v-model="supportCNAME"></checkbox>
                    <p class="comment">选中后表示允许任意域名使用此服务的CNAME直接访问此服务。需要节点服务器可以正确解析DNS记录。在严格匹配域名时才会生效。此选项可能导致安全问题，请谨慎开启。</p>
                </td>
            </tr>
        </table>
        <submit-btn></submit-btn>
    </form>
</div>